<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<script type="text/javascript" src="./build/react.js"></script>
	<script type="text/javascript" src="./build/react-dom.js"></script>
	<script type="text/javascript" src="./build/browser.min.js"></script>
	<title>React Props Syntax</title>
</head>
<body>
	<div id="example"></div>
	<script type="text/babel">
		var Timer = React.createClass(
			{
				getInitialState:function(){
					return {secondsElapsed:0};
				},
				tick:function(){
					this.setState({secondsElapsed:this.state.secondsElapsed+1});
				},
				componentDidMount:function(){
					this.interval=setInterval(this.tick,1000);
				},
				componentWillUnmount:function(){
					clearInterval(this.interval);
				},
				render:function(){
					return(
						<div> Seconds Elapsed:{this.state.secondsElapsed}</div>
					);
				}
			}
		);

		ReactDOM.render(<Timer />, document.getElementById('example'));
	</script>	
</body>
</html>